package com.han.hotelplat.dao.employee;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.han.hotelplat.comm.base.BaseDAO;
import com.han.hotelplat.pojo.employee.Employee;
import com.han.hotelplat.pojo.hotelmanager.Hotelmanager;

@Repository
public class EmployeeDao extends BaseDAO<Employee>{
	public Employee findEmployeeByUerid(String userid){
		List<Employee> users = findByProperty("userid", userid);
		if(users.size() == 0){
			return null;
		}
		return users.get(0);
	}

	public Employee findByPhone(String phone) {
		String hql = "from Employee where tel='"+phone+"'"; 
		List<Employee> list = findByHQL(hql);
		return list.size()>0?list.get(0):null;
	}
}
